﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FlyingAPI
{
    public class TestFlyingAPI
    {
        public static void testRequestSearchJob()
        {
            FlyingPig fp = new FlyingPig();
            String conn = "http://192.168.10.10:8080/TestServlet/";
            fp.setConnect(conn);
            SearchJob sj = fp.requestSearchJob();
            Console.WriteLine(sj.SearchJobId);
            Console.WriteLine(sj.getTime());
        }

        public static void testRequestSearchJobs()
        {
            FlyingPig fp = new FlyingPig();
            String conn = "http://192.168.10.10:8080/TestServlet/";
            fp.setConnect(conn);
            List<SearchJob> list_sj = fp.requestSearchJobs(10);
            foreach (SearchJob sj in list_sj)
            {
                Console.WriteLine(sj.SearchJobId);
                Console.WriteLine(sj.Concept);
            }
        }

        public static void testRequestImageInfos(int maxImageInfos, String concept)
        {
            FlyingPig fp = new FlyingPig();
            String conn = "http://192.168.10.10:8080/TestServlet/";
            fp.setConnect(conn);
            List<ImageInfo> list_ii = fp.requestImagesInfos(maxImageInfos, concept);
            foreach(ImageInfo ii in list_ii)
            {
                Console.WriteLine(ii.ImageId);
                Console.WriteLine(ii.Url);
                Console.WriteLine(ii.CacheState);
                Console.WriteLine();
            }
        }
    }
}
